#pragma once
#include <vector>
#include "common.h"

class BaseAlgorithm
{
public:
	BaseAlgorithm(
		const key_t& user_key,
		unsigned int Nr,
		unsigned int Nk,
		unsigned int Nb,
		unsigned int block_size,
		unsigned int block_number);
	virtual ~BaseAlgorithm();

	virtual cipher_t cipher(const plaintext_t& plaintext) = 0;
	virtual plaintext_t decipher(const cipher_t& ciphertext) = 0;

	virtual void round(
		int round_count,
		void* state,
		const key_t& round_key) = 0;
	virtual void inverse_round(
		int round_count,
		void* state,
		const key_t& round_key) = 0;

	virtual void key_schedule() = 0;


private:
	key_t user_key;
	std::vector<key_t> round_keys;

	unsigned int Nr;
	unsigned int Nk;
	unsigned int Nb;

	unsigned int block_size;
	unsigned int block_number;
};
